package com.akkainaction.tool.future.actor;

import akka.actor.UntypedActor;

public class CountActor extends UntypedActor {

    @Override
    public void onReceive(Object msg) throws Exception {
        //计算消息的字符数
        String message = (String) msg;
        int messageLength = message.length();
        System.out.println(getSelf() + "接收到消息:[" + message + "]-->消息的字符串长度:[" + messageLength + "]");
        getSender().tell(messageLength, getSelf());
    }
}
